{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#programming_fever\n",
    "#sharepenning of images using OpenCV\n",
    "import cv2\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "img = cv2.imread('E://OpenCV//bmw.png')\n",
    "img=cv2.resize(img,(300,300))\n",
    "cv2.imshow('Original', img)\n",
    "\n",
    "kernel_sharpen_1 = np.array([[-1,-1,-1], [-1,9,-1], [-1,-1,-1]])\n",
    "kernel_sharpen_2 = np.array([[1,1,1], [1,-7,1], [1,1,1]])\n",
    "kernel_sharpen_3 = np.array([[-1,-1,-1,-1,-1],\n",
    "                             [-1,3,3,3,-1],\n",
    "                             [-1,3,8,3,-1],\n",
    "                             [-1,3,3,3,-1],\n",
    "                             [-1,-1,-1,-1,-1]]) / 25.0\n",
    "\n",
    "output_1 = cv2.filter2D(img, -1, kernel_sharpen_1)\n",
    "output_2 = cv2.filter2D(img, -1, kernel_sharpen_2)\n",
    "output_3 = cv2.filter2D(img, -1, kernel_sharpen_3)\n",
    "\n",
    "cv2.imshow('Sharpening', output_1)\n",
    "cv2.imshow('Excessive Sharpening', output_2)\n",
    "cv2.imshow('Edge Enhancement', output_3)\n",
    "cv2.waitKey(0)\n",
    "cv2.destroyAllWindows()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
